﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

using Unity;
using Microsoft.Practices.Unity;

namespace Unity.Controllers
{
    public class HomeController : Controller
    {
        IA A;
        
        IB B;

        [Dependency]
        public IC C { get; set; }

        public HomeController(IA A)
        {
            this.A = A;
        }

        [InjectionMethod]
        public void Init(IB B)
        {
            this.B = B;                 
        }

        public ActionResult Index()
        {
            ViewBag.Message = "修改此模板以快速启动你的 ASP.NET MVC 应用程序。";
            var STR = this.A.Write();
            var STRb = this.B.Write();

            var S = this.C.Write();
            return View();
        }

        public ActionResult About()
        {
            ViewBag.Message = "你的应用程序说明页。";

            return View();
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "你的联系方式页。";

            return View();
        }
    }


}
